<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="ClientTemplate.xhtml">   
        <ui:define name="body"> 
            <h:form>   
                <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />  

                <h:outputText id="detailOrder" value="Details of Order" rendered="#{not empty orderDetailsController.cartBean}"/>
                <h:outputText value="Country"/>
                <p:inputText value="#{orderDetailsController.tblOrder.odCountry}" required="true" id="country" requiredMessage="phai nhap country"/>
                <p:message for="country" /> 
                <h:outputText value="City"/>
                <p:inputText value="#{orderDetailsController.tblOrder.odCity}" required=" true" id="city"/>
                <p:message for="city" /> 
                <h:panelGroup id="pgOrderDetails" rendered="#{not empty orderDetailsController.cartBean}">
                    <p:dataTable var="odItem" value="#{orderDetailsController.cartBean.cart}">
                        <p:column headerText="Elevation Name">
                            <h:outputText value="#{odItem.tblElevation.elName}"/>
                        </p:column>
                        <p:column headerText="Quantity">
                            <h:outputText value="#{odItem.oddQuantity}"/>
                        </p:column>
                        <p:column>
                            <p:commandButton value="Delete Elevation" action="#{orderDetailsController.deleteItemCart(odItem)}"/>
                        </p:column>
                    </p:dataTable>
                </h:panelGroup>            
                <p:commandButton value="Clear Cart" action="#{orderDetailsController.clearCart()}"/>
                <p:commandButton value="Submit" action="#{orderDetailsController.checkOut()}"  actionListener="#{orderDetailsController.checkLogin}" />
            </h:form>
        </ui:define>
    </ui:composition>
</html>

